package com.itheima.mapper;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface myBatisMapper {
    @Select("SELECT * FROM student")
    public abstract List<Student> selectAll();


    @Insert("INSERT INTO student VALUES (#{id} ,#{name} ,#{age})")
    @Options(useGeneratedKeys = true,keyColumn = "id" ,keyProperty = "id")
    public abstract Student insert(Student stu);

    @Update("UPDATE student SET name=#{name}, id=#{id},age=#{age} WHERE id=#{id}")
    public abstract Integer update(Student stu);

    @Delete("DELETE FROM student WHERE id=#{id}")
    public abstract Integer delete(Integer id);

}
